package com.forum.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

/**
 * <p>
 * 试题表
 * </p>
 *
 * @author 张继成
 * @since 2023-12-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("examtab")
public class ExamtabEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    public ExamtabEntity() {

    }

    public ExamtabEntity(T t) {
        try {
            BeanUtils.copyProperties(this, t);
        } catch (IllegalAccessException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    /**
     * 主键
     */
    @TableId
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    private Date addtime;

    /**
     * 所属相对应考试科目id
     */
    @TableField("PaperId")
    private Long paperid;

    /**
     * 模拟考试名称
     */
    @TableField("PaperName")
    private String papername;

    /**
     * 试题名称
     */
    @TableField("QuestionName")
    private String questionname;

    /**
     * 选项，JSON字符串
     */
    @TableField("options")
    private String Options;

    /**
     * 分值
     */
    @TableField("Score")
    private Long score;

    /**
     * 正确答案
     */
    @TableField("Answer")
    private String answer;

    /**
     * 答案相关解析
     */
    @TableField("analysis")
    private String analysis;

    /**
     * 试题类型，0：单选题，1：多选题
     */
    @TableField("type")
    private Long type;

    /**
     * 试题排序，值越大越排前面
     */
    @TableField("sequence")
    private Long sequence;


}
